feat: add rc and rr transaction isolation#319
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
KiteSQL did not expose configurable transaction isolation levels through
DataBaseBuilder, and ordinary reads in RocksDB-backed transactions were not pinned to a stable statement-level or transaction-level snapshot.That made it impossible to provide an explicit
ReadCommitted/RepeatableReadcontract at the database API layer, and it also left storage capabilities implicit instead of validated by the selected backend.Issue link:
What is changed and how it works?
TransactionIsolationLevel::{ReadCommitted, RepeatableRead}and plumb the selected level throughDataBaseBuilder,Database, and storage transaction creation.transaction_with_isolation,default_transaction_isolation, andvalidate_transaction_isolationso isolation semantics stay separate from storage-specific capabilities.ReadOptions:ReadCommittedcreates a fresh snapshot per statement.RepeatableReadkeeps one fixed snapshot for the whole transaction.RepeatableReadonly and memory support asReadCommittedonly, with builder-time validation for unsupported level requests.Code changes
Check List
Tests
Side effects
Note for reviewer
The main review surface is:
DatabaseBuilder/Databaseplumbing for isolation-level selection and storage capability validationReadCommittedandRepeatableReadValidation used for this branch:
cargo check --libcargo test --libcargo test test_lmdb_rejects_read_committed_isolation --lib --features lmdb